using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace SimCMS.UI
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        private static log4net.ILog logger = log4net.LogManager.GetLogger("Logger");
        public static void RegisterGlobalFilters(GlobalFilterCollection filters)
        {
            filters.Add(new HandleErrorAttribute());
        }

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapRoute(
              "AdminList", // Route name
              "Admin/AdminList/{Index}", // URL with parameters
              new { controller = "Admin", action = "AdminList", Index = 1 } // Parameter defaults
              );
            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "SpiderData", action = "index", id = UrlParameter.Optional } // Parameter defaults
                );
           

        }

        protected void Application_Start()
        {
            //AreaRegistration.RegisterAllAreas();

            //RegisterGlobalFilters(GlobalFilters.Filters);
            log4net.Config.XmlConfigurator.Configure();

            ControllerBuilder.Current.SetControllerFactory(typeof(SimCMS.Controllers.SpringControllerFactory));
            RegisterRoutes(RouteTable.Routes);
        }
    }
}